const seq = require('../connection/mysql_connect'),
      { STRING, INT } = require('../../config/db_type_config');

//define  seq定义表方法
const Slider = seq.define('slider', {
    cid: {
        comment: 'course ID',//注释
        type:  INT,          //字段类型
        allowNull: false,    //是否为空
        unique: true         //是否唯一
    },
    href: {
        comment: 'course detail page link',
        type: STRING,
        allowNull: false
    },
    imgUrl: {
        comment: 'course image url',
        type: STRING,
        allowNull: false
    },
    title: {
        comment: 'course name',
        type:STRING,
        allowNull: false
    },
    imgKey: {
        comment: 'qiniu image name',
        type: STRING,
        allowNull: false
    },
    status: {
        comment: 'course status',
        type: INT,
        defaultValue: 1,
        allowNull: false
    }
});

module.exports = Slider
